<template>
	<view style="padding: 20rpx;">
		<u-sticky>
			<!-- 选择框 -->
			<u-search :show-action="true" placeholder="搜索旅游信息" v-model="value" margin="0" @search="search(value)" @custom="search(value)"></u-search>
		
		</u-sticky>
		<u-card :sub-title="item.subTitle" v-for="(item,index) in talk" :key="index">
			<view class="" slot="body" @click="totalk(item)">
				<view class="u-body-item u-flex u-border-bottom u-col-between u-p-t-0" style="height: 200rpx;">
					<view class="u-body-item-title u-line-3 u-flex-3">{{item.text}}</view>
					<image :lazy-load="true" :src="item.img" class="u-flex-2" style="width: 100rpx;height: 100%;border-radius: 20rpx;"></image>
				</view>
			</view>
			<view class="" slot="foot" style="padding: 10px;"><u-icon name="chat-fill" size="34" color="" label="30评论"></u-icon></view>
		</u-card>
		<u-divider>没有啦</u-divider>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				talks:[],
				talk:[]
			}
		},
		methods: {
			search(value){
				this.talk=this.talks.filter(x=>
					x.text.includes(value)
				)
			},
			totalk(talk){
				uni.navigateTo({
				    url: '/pages/home/talk/talk?talk='+encodeURIComponent(JSON.stringify(talk))
				})
			}
		},
		mounted() {
			uni.request({
			  url: "http://127.0.0.1:4523/m1/1653531-0-default/info",
			  success: (res) => {
				this.talks=res.data.data[0].talk
				this.talk=this.talks
				// console.log(this.talk)
			  },
			  fail: (err) => {
			    // console.error(err,11111111111);
			  },
			});
			
		},
	}
</script>

<style>

</style>
